USE [VIETPUBLISHER]
GO

/****** Object:  Table [dbo].[T_BK_Order]    Script Date: 06/14/2012 23:26:29 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[T_BK_Order](
	[OrderID] [int] IDENTITY(1,1) NOT NULL,
	[OrderDate] [datetime] NULL,
	[PaymentMethod] [int] NULL,
	[UpdateDate] [datetime] NULL,
	[Note] [nvarchar](100) NULL,
	[UserName] [nvarchar](256) NULL,
	[Status] [int] NULL,
	[OrderCode] [varchar](15) NULL,
 CONSTRAINT [PK_Order] PRIMARY KEY CLUSTERED 
(
	[OrderID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[T_BK_Order]  WITH CHECK ADD  CONSTRAINT [FK_Order_OrderStatus] FOREIGN KEY([Status])
REFERENCES [dbo].[T_BK_OrderStatus] ([StatusID])
GO

ALTER TABLE [dbo].[T_BK_Order] CHECK CONSTRAINT [FK_Order_OrderStatus]
GO

ALTER TABLE [dbo].[T_BK_Order]  WITH CHECK ADD  CONSTRAINT [FK_Order_UserExtend] FOREIGN KEY([UserName])
REFERENCES [dbo].[T_BK_UserExtend] ([UserName])
GO

ALTER TABLE [dbo].[T_BK_Order] CHECK CONSTRAINT [FK_Order_UserExtend]
GO


